<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">

		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
		<title>{$web_name}</title>
		<meta name="keywords" content="{$web_keyword}">
		<meta name="description" content="{$web_description}">
		<meta http-equiv="Cache-Control" content="no-cache">
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Index/css/mui.min.css?k=<php>echo time();</php>">
	    <link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Index/css/shop_index.css?k=<php>echo time();</php>">
	    <link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Index/css/bottom.css?k=<php>echo time();</php>">
	    <script src="/themes/wnsc_moblie/newMobile/Index/js/jquery.min.js?k=<php>echo time();</php>"></script>
	    <script src="/themes/wnsc_moblie/newMobile/Index/js/mui.min.js?k=<php>echo time();</php>"></script>
		<script type="text/javascript" src="__TMPL__Public/js/common.js?k=<php>echo time();</php>"></script>
		<script type="text/javascript" src="/themes/wnsc/Public/js/echo.min.js?k=<php>echo time();</php>"></script>
		<script src="/themes/wnsc_moblie/newMobile/Shop/js/mobile/layer.js?k=<php>echo time();</php>"></script>
		<script src="/themes/wnsc/Home/Shop/js/jquery.lazyload.js?v=1.9.1"></script>


		<style type="text/css">
			#list_search_submit{margin-top: 6px;border-radius: 0 8px 8px 0;background: #ff7800;text-align: center;padding: 0px;width: 18%; color: #fff!important;font-size: 16px;margin-left: 0;}
			body {font-family: "微软雅黑", "宋体", Arial, Helvetica, sans-serif;}
		</style>
		<script>
            (function(){
                mui.init({
                    keyEventBind:{
                        backbutton:false
                    }
                });
            })()
		</script>
	</head>

	<body>


		<!-- 头部 -->
		<header>
			<div class="content">
				  <php>$site_city=cookie('site_city');</php>
				<span onclick="location='{:U("index/subsite")}'">{$site_city}</span>
				<form id="searchForm" name="searchForm" method="get" action="{:U('search/index')}" onSubmit="return checkSearchForm()">
							<div class="text_box" name="list_search_text_box" onclick="return 1;">
								<input id="keyword" name="keyword" type="text" placeholder="请输入商品名称" class="text" value="{$_GET['keyword']|default=''}">
								<input type="submit" value="搜索" class="submit" id="list_search_submit">
							</div>
				</form>
				
				
			</div>
		</header>
		<?php 
             $index_banner=sp_getslide(4);
             $count=count($index_banner);
         ?>
		<!-- banner -->
		<div class="mui-slider">
			<div class="mui-slider-group mui-slider-loop" id="banner_list">
				<!-- 先加一次最后一张（循环需要） -->
				<div class="mui-slider-item">
					<a href="{$index_banner[$count-1]['ad_link']}">
						<img  alt="pic" src="{$index_banner[$count-1]['UpFilePathInfo']}"  style="height: 50vw;"/></a>
				</div>
				<foreach name="index_banner" item="vo">
					<div class="mui-slider-item">
						<a href="{$vo.ad_link}">
							<img  alt="pic" src="{$vo.UpFilePathInfo}" style="height:  50vw;"/></a>
					</div>
				</foreach>
				<div class="mui-slider-item">
					<a href="{$index_banner[0]['ad_link']}">
						<img  alt="pic" src="{$index_banner[0]['UpFilePathInfo']}"   style="height: 50vw;"/></a>
				</div>
			</div>
			<!-- banner下方点的个数 -->
			<div class="mui-slider-indicator" id="banner_point">
				<foreach name="index_banner" item="vo">
					<div class="mui-indicator <eq name='key' value='0'>mui-active</eq>"></div>
				</foreach>

			</div>
		</div>
		<?php 
		$index_silde=sp_get_menu_tree(6);
		$i=1;
	?>
		<!-- 图标分类 -->
		<div class="index_icon">
			<div class="icons">
				<foreach name="index_silde" item="v">
				<eq name="i" value="5">
					<empty name="_SESSION['user_id']">
						<a href="{:U('user/login')}" data="{$i}">	
					</empty>
					
					<notempty name="_SESSION['user_id']">
						<a href="{$v.href}" data="{$i}">
					</notempty>
				</eq>
				<neq name="i" value="5">
					<a href="{$v.href}" data="{$i}">
				</neq>
						<span class="icon_{$i}">
							<i style="background: url({$v.UpFilePathInfo}) center no-repeat;"></i>
						</span>
						<span class="text">{$v.label}</span></a>
					<php>$i++;</php>
				</foreach>
			</div>
		</div>
		<?php 
         $todays=sp_getslide(2);
		 if($todays){
       ?>
		<!-- 今日好价 -->
		<div class="case">
			<div class="sales_goods">
				<img src="/themes/wnsc_moblie/newMobile/Index/images/index/salesgoods.jpg" alt="">
			</div>
			<div style="height: 270px; overflow-y: hidden;">
				<div class="tag_kind ">
					<div class="tag_kind_in clearfix">

						<foreach name="todays" item="v" key="k">
							<lt name="k" value='10'>
							<php>
								$id=explode('/',$v['ad_link']);
								$id=$id['4'];
								$id=explode('.',$id);
								$id=$id['0'];
								$rs=shop_type($id);
							</php>
							<a href="{$v.ad_link}" style="position: relative;">
								<img  alt="pic" src="{$v.UpFilePathInfo}" >
								<php>if($rs['tuan']==1){</php><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width: auto;height: auto;top: 10px;left: 15px;"><php>}</php>
								<div>
									<p>{$v.ad_title}</p>
									<p class="price">{$v.price}</p>
								</div>
							</a>
							</lt>
						</foreach>
					</div>

				</div>
			</div>

		</div>
		<php>}</php>
		<!-- 附近店铺 -->
		<php>$local_store=get_local_store();</php>
		<notempty name="local_store">
		<div class="news">
			<div class="pro_tilte">
				<span></span>
				<span>同城店铺</span>
			</div>

			<div class="classfiy_list">
				<div class="listsa">
					<foreach name="local_store" item="v">
					<div class="list_item">
						<a href="{:U('store/index',array('id'=>$v['id']))}">
							<div class="pic-wrapper">
								<img  class="lazy" data-original="{$v.logo}" alt="{$v.title}">
							</div>
							<php>
								$zonghe=($v['store_desccredit']+$v['store_deliverycredit']+$v['store_servicecredit'])/3;
							</php>
							<div class="desc-wrapper">
								<h1><eq name="v.quanwang" value="1">【全网】</eq> <eq name="v.quanwang" value="0">【{$v.city_name|default='全国'}】</eq>{$v.title}</h1>
								<p class="star">
									<img src="/themes/wnsc_moblie/newMobile/Index/images/index/stars{:number_format($zonghe,0, '.', '')}.png" alt=""></p>
								<div class="last">
									<span>{$v.city_name|default='全国'}</span>
								</div>
							</div>
						</a>
					</div>
					</foreach>

				</div>
			</div>
		</div>
		</notempty>
		<!-- 热门团购 -->
		<div class="hot_tuan">
			<div class="tuan">
				<span></span>
				<span>热门团购</span>
			</div>
			<div class="hot_content">
				<foreach name="ptuan" item="v">
					<php>	$rs=shop_type($v['id']);</php>
				
				<div class="tuan_box" style="text-align: center;">
					<a href="{:U('shop/index',array('id'=>$v['id']))}">
						<div class="hotpic_box" style="position: relative;">
							<php>
								 $m_thumb=$_SERVER['DOCUMENT_ROOT'].$v['image'].'-m_thumb.jpg';
								 if(file_exists($m_thumb)){
								 	$image_src=$v['image'].'-m_thumb.jpg';
								 }else{
								 	$image_src=$v['image'];
								 }
							</php>
							<img class="lazy" data-original="{$image_src}" >
							<img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width:10%;height: auto;top: 0;left: 0px;">
						</div>
						<p style="width:100%;margin: 0 auto;text-align: left; padding-top: 15px;"><notempty name="rs['story']"><a href="{:U('shop/store',array('id'=>$v['id']))}" style="color: red;text-decoration: underline;font-size:16px;">{$rs['story']}</a></notempty></p>

						<p class="title"><php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 5px 10px 5px 17px;color: #fff;background-size: 100% 100%;margin-right: 5px;font-style: inherit;font-size: 12px;">优惠券</em><php>}</php>{$v.title}</p>
						<p class="price">￥{$v.tuan_price} <span class="go">去开团<i></i></span></p>
					</a>
				</div>
				</foreach>
			</div>
		</div>
		<?php 
         $hot_store=sp_getslide(3);
		  if($hot_store){
      ?>
		<!-- 品牌店铺 -->
		<div class="pros">
			<div class="pro_tilte">
				<span></span>
				<span>品牌店铺</span>
			</div>
			<div class="brand">
				<foreach name="hot_store" item="v" key="k">
					<a href="{$v.ad_link}"><img    class="lazy" data-original="{$v.UpFilePathInfo}" alt="{$v.ad_title}">
					</a>
				</foreach>

			</div>
		</div>
		<php>}</php>
		<!-- 商品推荐 -->
		<div class="pros">
			<div class="pro_tilte">
				<span></span>
				<span>商品推荐</span>
			</div>
			<div class="pro_content">
				<foreach name="recommend" item="v">
					<php>
						 $m_thumb=$_SERVER['DOCUMENT_ROOT'].$v['image'].'-m_thumb.jpg';
						 if(file_exists($m_thumb)){
						 	$image_src=$v['image'].'-m_thumb.jpg';
						 }else{
						 	$image_src=$v['image'];
						 }
					</php>
					<php>	$rs=shop_type($v['id']);</php>
					<a href="{:U('shop/index',array('id'=>$v['id']))}"  style="position: relative;overflow: hidden;">
						<php>if($rs['tuan']==1){</php><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width: 20%;height: auto;top: 0;left: 0px;"><php>}</php>
						<img   class="lazy" data-original="{$image_src}" alt="{$v['title']}"><span><php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 1px 10px 2px 15px;color: #fff;background-size: 100% 100%;margin-right: 5px;font-style: inherit;font-size: 12px;">优惠券</em><br/><php>}else{</php><em style="height: 15px;width: 100%; display: block;"></em><php>}</php>{$v['title']}</span></a>
				</foreach>

			</div>
		</div>
		<!-- 悟能产品 -->
		<div class="pros">
			<div class="pro_tilte">
				<span></span>
				<span>热门商品</span>
			</div>
			<div class="pro_content">
				<foreach name="hot_list" item="v">
					<php>
						 $m_thumb=$_SERVER['DOCUMENT_ROOT'].$v['image'].'-m_thumb.jpg';
						 if(file_exists($m_thumb)){
						 	$image_src=$v['image'].'-m_thumb.jpg';
						 }else{
						 	$image_src=$v['image'];
						 }
					</php>
					<php>	$rs=shop_type($v['id']);</php>
					<a href="{:U('shop/index',array('id'=>$v['id']))}" style="position: relative;overflow: hidden;">
						<img    class="lazy" data-original="{$image_src}" alt="{$v['title']}">
						<php>if($rs['tuan']==1){</php><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width: auto;height: auto;top: 0;left: 0px;"><php>}</php>
						<span><php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 1px 10px 2px 15px;color: #fff;background-size: 100% 100%;margin-right: 5px;font-style: inherit;font-size: 12px;">优惠券</em><br/><php>}else{</php><em style="height: 10px;width: 100%; display: block;"></em><php>}</php>{$v['title']}</span></a>
				</foreach>
			</div>
		</div>

		<!-- 猜你喜欢 -->
		<div class="pros">
			<div class="pro_tilte">
				<span></span>
				<span>猜你喜欢</span>
			</div>
			<ul class="listBox">
				<li class="active_list">
					<foreach name="like_list" item="v">
						<php>
						 $m_thumb=$_SERVER['DOCUMENT_ROOT'].$v['image'].'-m_thumb.jpg';
						 if(file_exists($m_thumb)){
						 	$image_src=$v['image'].'-m_thumb.jpg';
						 }else{
						 	$image_src=$v['image'];
						 }
					</php>
						<php>	$rs=shop_type($v['id']);</php>
						<a class="goods" href="javascript:;">
							<div class="goods_a" style="position: relative;" onclick="location.href='{:U(\'shop/index\',array(\'id\'=>$v[\'id\']))}'"><img  class="lazy" data-original="{$image_src}" alt="{$v['title']}"><php>if($rs['tuan']==1){</php><img src="/static/images/tuan.png" alt="此商品参与团购" style="position: absolute;z-index: 999;width: auto;height: auto;top: 0;left: 0px;"><php>}</php></div>
							<div class="list_txt"  onclick="location.href='{:U(\'shop/index\',array(\'id\'=>$v[\'id\']))}'"><php>if($rs['coupon']==1){</php><em style="background-image: url('/static/images/yhq.png');padding: 5px 10px 5px 17px;color: #fff;background-size: 100% 100%;margin-right: 5px;font-style: inherit;font-size: 12px;">优惠券</em><php>}</php>{$v['title']}</div>

							<p style="height:15px;color: red;padding-left: 11px;font-size:12px;text-decoration: underline;overflow: hidden;line-height: 15px;width: 100%;white-space: nowrap;text-overflow: ellipsis;" onclick="location.href='{:U(\'shop/store\',array(\'id\'=>$v[\'id\']))}'"><notempty name="rs['story']">{$rs['story']}</notempty></p>
							<p class="p_price"  onclick="location.href='{:U(\'shop/index\',array(\'id\'=>$v[\'id\']))}'">￥{$v.price}</p>


						</a>
					</foreach>
					<div class="goods_btm">
						没有更多了~
					</div>
				</li>
			</ul>
		</div>


<script type="text/javascript" charset="utf-8">

  $(function() {

      $("img.lazy").lazyload({effect: "fadeIn"});

  });

</script>


		<style>
			/*footer_nav1底部悬浮菜单css*/
			.v_nav { position: fixed; bottom: 0; width: 100%; height:50px; background-color:#fff;border-top: #dcdcdc 1px solid; z-index: 9999;padding:0px; margin:0px; padding-bottom:2px; padding-top:2px ;line-height: 25px;}
			.vf_nav{ width:100%;height:50px; margin:auto; padding:0px; margin:0px;}
			.vf_nav ul li{ width:20%; height:50px; float:left; text-align:center; margin:0px;}
			.vf_nav ul li a{ text-align:center; font-size:12px; color:#333; width:45px; display:block; height:50px; position: relative; margin:auto}
			.vf_nav ul li i{ display:block;  width:25px; height:25px; margin:auto; line-height: 25px;}

			.vf_1{ background-position:-2px -6px;}
			.vf_2{ background-position:-2px -47px; }
			.vf_3{ background-position:0 -81px;}
			.vf_4{ background-position:-1px -114px;}
			.vf_5{  background-position:-1px -147px;}

			.vf_nav ul li span{ display:block; width:100%; height:20px; line-height:20px;}
			.vf_nav ul li a:active{color: #ff7171;}
			.global-nav__nav-shop-cart-num{
				position: absolute;
				top: -6px;
				color: #fff;
				text-align: center;
				font-weight: normal;
				font-size: 12px;
				width: 25px;
				height: 25px;
				line-height: 25px;
				background: #ff2233;
				border-radius: 50%;
				-webkit-transform-origin-x: 0;
				-webkit-transform: scale(0.65);}

		</style>
		<mtc_include file="Public:footer" />
		<script>
			//获得slider插件对象
			var gallery = mui('.mui-slider');
			gallery.slider({
				interval: 3000 //自动轮播周期，若为0则不自动播放，默认为0；
			});
			
			function checkSearchForm(){
				var keyword= $('#keyword').val();
				if(keyword){
					return true;
				}else{
					alert('请输入商品名称！')
					return false;
				}
			}
			Echo.init({
			    offset: 500,
			    throttle: 0
			});
		</script>
		<php> if($signPackage){</php>
			<script type="text/javascript"  src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
			<script>
		
		 wx.config({
		      debug: false,//设置调试模式
		      appId: "{$signPackage['appId']}",  //公众号的唯一标识
		      timestamp: '{$signPackage["timestamp"]}',  //生成签名的时间戳
		      nonceStr: '{$signPackage["nonceStr"]}',   //生成签名的随机串
		      signature: '{$signPackage["signature"]}',  //签名
		      jsApiList: [         
		         'onMenuShareTimeline',
		         'onMenuShareAppMessage',
		         'onMenuShareWeibo',
		         'onMenuShareQQ',
		         'onMenuShareQZone',
		         'hideMenuItems',
		         'showMenuItems'      
		         ]   
		    })
		
		var link = "https://{$_SERVER['HTTP_HOST']}";
		var title="{$web_name}";
		var	desc='好货好价好服务，一起实惠一起拼，手慢无哟';
		var	imgUrl="https://{$_SERVER['HTTP_HOST']}/favicon.ico";
		   wx.ready(function(){
		      wx.onMenuShareTimeline({
		         title: title,
		         link: link,
		         imgUrl: imgUrl,
		         trigger: function (res) {
		 
		         },
		         success: function (res) {

                     layer.open({
                         content: '分享成功'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		            $('#cover').hide();
					$('#guide').hide();
					again_tip();
		         },
		         cancel: function (res) {
                     layer.open({
                         content: '您已取消分享'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		         	 $('#cover').hide();
					$('#guide').hide();
		                
		         }
		      });
		 
		      wx.onMenuShareAppMessage({
		         title: title,
		         desc: desc,
		         link: link,
		         imgUrl: imgUrl,
		         success: function (res) {
                     layer.open({
                         content: '分享成功'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		            $('#cover').hide();
					$('#guide').hide();
					again_tip();
		            },
		         cancel: function (res) {
                     layer.open({
                         content: '您已取消分享'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		            $('#cover').hide();
					$('#guide').hide();
		            }
		      });
		 
		      wx.onMenuShareWeibo({
		         title: title,
		         desc: desc,
		         link: link,
		         imgUrl: imgUrl,
		         success: function () {
                     layer.open({
                         content: '分享成功'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		           $('#cover').hide();
					$('#guide').hide();
					again_tip();
		            },
		         cancel: function () {
                     layer.open({
                         content: '您已取消分享'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		           $('#cover').hide();
					$('#guide').hide();
		            }
		      });
		 
		      wx.onMenuShareQQ({
		         title: title,
		         desc: desc,
		         link: link,
		         imgUrl: imgUrl,
		         success: function () {
                     layer.open({
                         content: '分享成功'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		            $('#cover').hide();
					$('#guide').hide();
					again_tip();
		          },
		         cancel: function () {

                     layer.open({
                         content: '您已取消分享'
                         ,skin: 'msg'
                         ,time: 2 //2秒后自动关闭
                     });
		            $('#cover').hide();
					$('#guide').hide();
		         }
		      });
		   });
		 
		</script>
			<php> }</php>
        <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=9skQ8QpKqZOzGHYeAwZt4GquLX5OrhXm"></script>
        <div id="allmap" style="width: 0;height: 0;display: none;"></div>
		<?php
				$agent = $_SERVER['HTTP_USER_AGENT'];
				if(strpos($agent,"Html5Plus") === false){
			?>

		<script type="text/javascript">
            // 百度地图API功能
            var map = new BMap.Map("allmap");
            var point = new BMap.Point(116.331398,39.897445);
            map.centerAndZoom(point,12);
            var geoc = new BMap.Geocoder();
            var geolocation = new BMap.Geolocation();
            geolocation.getCurrentPosition(function(r){
                if(this.getStatus() == BMAP_STATUS_SUCCESS){
                    var mk = new BMap.Marker(r.point);
                    map.addOverlay(mk);
                    map.panTo(r.point);
                    pt=r.point;
                    var city=r.address.city;
                    console.log(r.address)
                    var lat=r.point.lat;
                    var lng=r.point.lng;
                    console.log(r.point.lat);
                    console.log(r.point.lng);
                    geoc.getLocation(pt, function(rs){
                        var addComp = rs.addressComponents;
                        var province = addComp.province;
                        var city2 = addComp.city;
                        var district = addComp.district;

                        $.ajax({
                            type: "POST",
                            url: "{:U('api/gps_dw')}",
                            data: {city:city,lat:lat,lng:lng,province:province,city2:city2,district:district},
                            dataType: "json",
                            success: function (data) {

                                //城市定位成功,询问是否跳转
                                if(data.status==0){
                                    var rs_city_id=data.data.city_id;
                                    layer.open({
                                        content: '定位您在<img src="/themes/wnsc_moblie/newMobile/Index/images/dingwei.png?k=<php>echo time();</php>" style="width: 4%;margin: 0 5px;padding: 0;position: relative;top: 3px;">'+city+'<br/>是否切换至该城市进行探索？'
                                        ,btn: ['是的', '不需要']
                                        ,yes: function(index){
                                            location.href='/index/subsite/type/1/id/'+rs_city_id+'.html';
                                        },no: function(index){
                                            location.href='/index/subsite/type/2.html';
                                        }
                                    });
                                }
                            }
                        })

                    });



                }
                else {
                    console.log('failed'+this.getStatus());
                }
            },{enableHighAccuracy: true})

		</script>
		<?php
			}else{
			    if(session('no_qiecity')!=1){
			?>
        <script src="/themes/wnsc_moblie/newMobile/Index/js/plusGeolocation.js?k=<php>echo time();</php>"></script>

        <script>
            $(function () {
                var tongyi_dingwei=getCookie('tongyi_dingwei');
                console.log(tongyi_dingwei);
                // 判断是否在5+环境下
                var isPlus = navigator.userAgent.indexOf("Html5Plus") > -1;
                console.log(isPlus);
                if (isPlus) {
                 	getlocation();
				}
                 /**
                 * 点击按钮获取位置信息
                 */
                function getlocation() {

                    if (isPlus) {
                        navigator.geolocation.getCurrentPosition(function (p) {
                               var lon= p.coords.longitude;
                               var lat= p.coords.latitude;
							   var ggPoint = new BMap.Point(lon,lat);

								//地图初始化
								var bm = new BMap.Map("allmap");
								bm.centerAndZoom(ggPoint, 15);
								bm.addControl(new BMap.NavigationControl());

								//添加gps marker和label
								var markergg = new BMap.Marker(ggPoint);
								bm.addOverlay(markergg); //添加GPS marker
								var labelgg = new BMap.Label("未转换的GPS坐标（错误）",{offset:new BMap.Size(20,-10)});
								markergg.setLabel(labelgg); //添加GPS label
                                var geoc = new BMap.Geocoder();
								//坐标转换完之后的回调函数
								translateCallback = function (data){
									if(data.status === 0) {
                                       	var lat=data.points[0].lat;
										var lon=data.points[0].lng;
                                        var marker = new BMap.Marker(data.points[0]);
										bm.addOverlay(marker);
										var label = new BMap.Label("转换后的百度坐标（正确）",{offset:new BMap.Size(20,-10)});
										marker.setLabel(label); //添加百度label
										bm.setCenter(data.points[0]);
                                        pt=data.points[0];
                                 		geoc.getLocation(pt, function(rs){
                                            var addComp = rs.addressComponents;
                                         
                                            var province = addComp.province;
                                            var city = addComp.city;
                                            var district = addComp.district;
                                         	$.ajax({
                                                type: "POST",
                                                url: "{:U('api/gps_zbaidudw_h5')}",
                                                data: {lon:lon,lat:lat,province:province,city:city,district:district},
                                                dataType: "json",
                                                success: function (data) {

                                                }
                                            })

										});
									}
								}

								setTimeout(function(){
									var convertor = new BMap.Convertor();
									var pointArr = [];
									pointArr.push(ggPoint);
									convertor.translate(pointArr, 1, 5, translateCallback)
								}, 1000);

                            $.ajax({
                                type: "POST",
                                url: "{:U('api/gps_dw_h5')}",
                                data: {lon:lon,lat:lat,type:1},
                                dataType: "json",
                                success: function (data) {

                                    //城市定位成功,请跳转匹配
                                    if(data.status==1){
                                        var rs_city_id=data.data.city_id;
                                        location.href='/index/subsite/type/1/id/'+rs_city_id+'.html';
                                    }
                                    //城市定位成功,询问是否跳转
                                    if(data.status==0){
                                        var rs_city_id=data.data.city_id;
                                        layer.open({
                                            content: '定位您在<img src="/themes/wnsc_moblie/newMobile/Index/images/dingwei.png?k=<php>echo time();</php>" style="width: 4%;margin: 0 5px;padding: 0;position: relative;top: 3px;">'+data.data.city_name+'<br/>是否切换至该城市进行探索？'
                                            ,btn: ['是的', '不需要']
                                            ,yes: function(index){
                                                location.href='/index/subsite/type/1/id/'+rs_city_id+'.html';
                                            },no: function(index){
                                                location.href='/index/subsite/type/2.html';
                                            }
                                        });
                                    }
                                }
                            })
                         }, function (err) {
                            console.log(err)
                        })

                    }
                }

                /*
                 功能：保存cookies函数
                 参数：name，cookie名字；value，值
                 */
                function SetCookie(name,value){
                    var Days = 30*12;  //cookie 将被保存一年
                    var exp = new Date(); //获得当前时间
                    exp.setTime(exp.getTime() + Days*24*60*60*1000); //换成毫秒
                    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
                }
                /*
                功能：获取cookies函数
                参数：name，cookie名字
                */
                function getCookie(name){
                    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
                    if(arr != null){
                        return unescape(arr[2]);
                    }else{
                        return null;
                    }
                }
            })



         </script>

        <?php
             }
			}
			?>
	</body>

</html>